home *** CD-ROM | disk | FTP | other *** search
- Path: news.luc.edu!user
- From: VArase@varase.it.luc.edu (Verne Arase)
- Newsgroups: comp.lang.c
- Subject: Re: HELP. How to convert '0x12' into FF char?
- Date: Thu, 21 Mar 1996 08:44:08 -0600
- Organization: LUMC
- Message-ID: <AD76C75896683B250@mcdialb11.it.luc.edu>
- References: <4iissm$s76@nntp.ucs.ubc.ca> <17MAR199623533662@erich.triumf.ca> <827344614snz@genesis.demon.co.uk>
- NNTP-Posting-Host: 147.126.240.127
-
- In article <827344614snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
-
- >>>f='0x';
- >>>strcpy(f,d);
- >>>strcpy(f,e);
- >>>
- >>>f now contains the string '0x12' right?
- >>
- >>No.
- >
- >Indeed, it isn't even legal code.
-
- Well, it's probably not legal (or at least suffers from suspicious pointer
- conversion).
-
- What this would probably end up doing is copying characters until the first
- NUL charcter is found from absolute memory location 0x00000032 (if ASCII)
- or 0x000000F1 (if EBCDIC).
-
- >>but if you have:
- >> char f[10] = "0x";
- >> char d[2] = "1";
- >> char e[2] = "2";
- >> strcpy(f,d);
- >> strcpy(f,e);
- >
- >I assume you mean strcat() here.
-
- strcat(), like strcpy(), works with character _pointers.
-
- ---
- The above are my own opinions, and not those of my employer.
-